package com.tzy.newbank.controller;

import com.tzy.newbank.BankDao.JAPService;
import com.tzy.newbank.Pojo.Bankuser2;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@Slf4j
@RestController
@RequiredArgsConstructor
public class JPAController {
    final private JAPService japService;

    //使用JPA 查询数据库
    @RequestMapping("/jpa")
    public Iterable<Bankuser2> getAll(){
        log.info(japService.getAll().toString());
        return japService.getAll();
    }
}
